<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCommissionDetailTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('commission_detail', function (Blueprint $table) {
            $table->increments('id')->comment('自增id');
            $table->integer('user_id')      ->default(0)->comment('返成接受者');
            $table->integer('from_user_id') ->default(0)->comment('返成贡献者');
            $table->string('order_num')     ->nullable()->comment('订单号');
            $table->integer('level')        ->nullable()->comment('等级:1,2,3级');
            $table->integer('type')         ->default(0)->comment('类型:1新增，2提现');
            $table->decimal('amount')       ->default(0)->comment('金额');
            $table->integer('status')       ->default(0)->comment('状态:0进行中，1已完成，2失败');
            $table->string('remark')        ->nullable()->comment('备注');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
